class Cal:
    def __call__(self, *args, **kwargs):
        print('args = {}, kwargs = {}'.format(args, kwargs))
        fn = kwargs['fn']
        return fn(args[0], args[1])


a = Cal()
print(a(2, 3, fn=lambda x, y: x + y))

# object(参数列表)相当于调用类的__call__方法，若__call__没有定义则会报错
